package com.global.college.adapter;

import android.content.Intent;
import android.view.View;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.global.college.R;
import com.global.college.data.inner.StudentBean;
import com.global.college.ui.activity.WebViewActivity;

public class StudentItemAdapter extends BaseQuickAdapter<StudentBean, BaseViewHolder> {

    public StudentItemAdapter() {
        super(R.layout.item_student);
    }

    @Override
    protected void convert(BaseViewHolder helper, StudentBean bean) {
        helper.setText(R.id.tv_student_name, bean.getName());
        helper.setText(R.id.tv_student_salary, bean.getSalary());
        helper.setText(R.id.tv_student_intro, bean.getIntro());
        helper.setText(R.id.tv_work_place,"现就职："+bean.getWorkPlace());
        ImageView iv = helper.getView(R.id.iv_student_pic);
        Glide.with(mContext).load(bean.getPicId()).into(iv);
        helper.itemView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                mContext.startActivity(new Intent(mContext, WebViewActivity.class)
                        .putExtra("url","http://h5.uton.net/trainee").putExtra("title","明星学员"));
            }
        });
    }

}
